package org.ilead.iserve.service;

import java.util.List;

import org.ilead.iserve.model.User;

public interface IUserService {
	
	/**
	 * 查看用户名是否已经注册
	 * @param loginName
	 * @return
	 */
	boolean hasNameRegister(String loginName);
	
	/**
	 * 查看邮箱是否已经注册
	 * @param loginName
	 * @return
	 */
	boolean hasEmailRegister(String email);
	
	
	/**
	 * 用户登录
	 * @param loginName
	 * @param password
	 * @return
	 */
	User login(String loginName, String password);
	
	public List<User> findAll();
	public List<User> findByPermission(int permission);
	public List<User> findByLoginName(String loginName);
	public User findById(Integer id);
	public void addUser(User u) throws Exception ;
	public void updateUser(User u) throws Exception ;
	public void delUserById(Integer id) throws Exception ;
}
